UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ltmOdxG3Z5PWe66dCMDizgS4RYOJ8yuyd2ete0yuxHE='
WHERE
key_id = 'ee9a45876198cd625d77037460cee68045eb6d4517a36f5d1692999fc1a39f68'
AND (
token = 'ltmOdxG3Z5PWe66dCMDizgS4RYOJ8yuyd2ete0yuxHE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)