UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ry80JpQvs5DIJ35pqbVJLpeoz430Voxgcsbvkq4sMWc='
WHERE
key_id = '84507792f4f7b0b29e54000dbd99fa83094f2832def2768b95498aee5cbdcb63'
AND (
token = 'Ry80JpQvs5DIJ35pqbVJLpeoz430Voxgcsbvkq4sMWc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)