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