UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FQFRth6N5i0gbvWBR0jWjn+DeeOyEXu4CPix6UdU/sI='
WHERE
key_id = '00e6cf8022c97fcb726f31f3d329db70554b1282ec2b034d6451f58b55239fbb'
AND (
token = 'FQFRth6N5i0gbvWBR0jWjn+DeeOyEXu4CPix6UdU/sI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)