UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/14CVf+Q5fm0T8l4wtFxXqSVynIV41Gyhsz17YQqNg4='
WHERE
key_id = 'd14464e11d33ed45b3eb8725b0e226b69a2a5c2fc22517e3bc19ceeb68883171'
AND (
token = '/14CVf+Q5fm0T8l4wtFxXqSVynIV41Gyhsz17YQqNg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)