UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '55r0Gu5AEG6C4f4lq+GnVpT29LBp/qrdOZX4I4nuYW0='
WHERE
key_id = '8ec6640945f7913930687b2add580cbfa6ac4ab6f135da1d1fe5210ec5fa9f65'
AND (
token = '55r0Gu5AEG6C4f4lq+GnVpT29LBp/qrdOZX4I4nuYW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)