UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sOnHRJ7rVttZOyNSLGaY5LDdtuZvsojU1pGKz6S3/S4='
WHERE
key_id = '0854c97e23f059eb61e3be09c4d4f2ad2da23b683cadc180674b8d0c9b8fc6d5'
AND (
token = 'sOnHRJ7rVttZOyNSLGaY5LDdtuZvsojU1pGKz6S3/S4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)