UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0/N/c9bB+1qan/HhV4gMQzcAd0zk1tRIXL01ocjTi58='
WHERE
key_id = '2ba11309a96765fa0c2620b58b22b4bbad1921eb73454ae7fc5dd6a66a4e30e9'
AND (
token = '0/N/c9bB+1qan/HhV4gMQzcAd0zk1tRIXL01ocjTi58='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)