UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rHEHe2Gz0QSGIBVumEBjTdKMhweppozlaVyo6bpzTHQ='
WHERE
key_id = '4f4e2ca42926ace8afcdea4c5c0e250546e78a8baa4c031dd6db4c674a2e4de3'
AND (
token = 'rHEHe2Gz0QSGIBVumEBjTdKMhweppozlaVyo6bpzTHQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)