UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RoFSnwmKSizv27SqUw3LOEO3bEooLN2s9zQKhpyHnb4='
WHERE
key_id = '1c14f2f945eca38cc14512c4f4044ae3ac91ecc814453b01599ec5fa82345823'
AND (
token = 'RoFSnwmKSizv27SqUw3LOEO3bEooLN2s9zQKhpyHnb4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)