UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's5QmhdyGgQ1WgubAFTmuisRdLX07Xsh5ZVRcUJr6iyY='
WHERE
key_id = '7237c155ac1cee0e939233d237d4cd28633fc454169788a4e73d83f6e2307277'
AND (
token = 's5QmhdyGgQ1WgubAFTmuisRdLX07Xsh5ZVRcUJr6iyY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)