UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w+EgB4JJZS3MpkyX/oJH3wiuF6EqpYLmoDwCZ1xy7Jo='
WHERE
key_id = 'fc526e9002d90f162cf51d1ac704ef4a7bf10858a91d1818bceee19d76ced93f'
AND (
token = 'w+EgB4JJZS3MpkyX/oJH3wiuF6EqpYLmoDwCZ1xy7Jo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)