UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eJgq0qvYLwiDVOH85/STmwP/F9tGSs8bs57iRV6KoHY='
WHERE
key_id = '0bdfaa042db0f756ebcbbbd34a2e02b6f0aa9f4d8eb4dab9f9e322146c34c82c'
AND (
token = 'eJgq0qvYLwiDVOH85/STmwP/F9tGSs8bs57iRV6KoHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)