UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Offp4yw+Ns6goxbjdhxBJk1Dp4WG5kyZ2k57/NvL/Y='
WHERE
key_id = '54c33eae75bd81df48ea09319ccffea4abf9ff248cb910fd1fd75cdb0be3e2e0'
AND (
token = '2Offp4yw+Ns6goxbjdhxBJk1Dp4WG5kyZ2k57/NvL/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)