UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zmme3DD40Vc4SUhFS++2pFaIDZjPCcfXIQ2imOQuxBI='
WHERE
key_id = '9d3ba3cec903eaeba79ae276363ef3a9ec040cb158ff74b0397a4a217b23b256'
AND (
token = 'Zmme3DD40Vc4SUhFS++2pFaIDZjPCcfXIQ2imOQuxBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)