UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OZU6kcO/1/4ihBjLSkv2ajviBJh0mwOtWztn7i2e/UI='
WHERE
key_id = 'd9dd2f1ec64430b426ddfa68c346b5e459fdd00666b6a57e0fe1fe76935428bc'
AND (
token = 'OZU6kcO/1/4ihBjLSkv2ajviBJh0mwOtWztn7i2e/UI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)