UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yFdjjZ0tPtXU6BaUfyFZf3WUu2Y0XzJLEabquA3fF/s='
WHERE
key_id = '8620806640ae95630430f6ee0fbbe2413835f9efc1eba6a319b25923a85ef63e'
AND (
token = 'yFdjjZ0tPtXU6BaUfyFZf3WUu2Y0XzJLEabquA3fF/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)