UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V8PrCVVKFQxZikVOVWTXiFnfSAVoJQD4kXhbPJ+713g='
WHERE
key_id = '96e67526bd98af6ed904d9badb8b363ea08bc981fc97a53372eb5423b4e8dd3f'
AND (
token = 'V8PrCVVKFQxZikVOVWTXiFnfSAVoJQD4kXhbPJ+713g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)