UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'anTuv+M0s/21ptcR3m+t8f3Hfg4gsRI3iEnzEmerD2w='
WHERE
key_id = 'bada2dd9427344616c5d51fa839fcff22e97f81acbb20942e583f78bbd1e6b8b'
AND (
token = 'anTuv+M0s/21ptcR3m+t8f3Hfg4gsRI3iEnzEmerD2w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)