UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7n3e9a9FicGna8yNuonTA1aRFwfOxOJS9VhckylLF00='
WHERE
key_id = 'fbf05add443747146fe4a80e1dd1b33ae5333e52986bb93b220d3426b8c6c941'
AND (
token = '7n3e9a9FicGna8yNuonTA1aRFwfOxOJS9VhckylLF00='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)