UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j2Dhsvu5suoyprb5QvrDJxJgGjSALROqxmTcUYKQ9n0='
WHERE
key_id = '9cbdfe0806591f12999108a56e7e5568f76de1b1ba93b0dad2ed830cb22af26f'
AND (
token = 'j2Dhsvu5suoyprb5QvrDJxJgGjSALROqxmTcUYKQ9n0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)