UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8+02vaNFzOPf80oAdYDyv1aV9EvvZvQvJpq/s6+La5g='
WHERE
key_id = 'a4dbf326186798b42ec91465dc33f5fc03d50ff955cbf44e887946da8336ffa0'
AND (
token = '8+02vaNFzOPf80oAdYDyv1aV9EvvZvQvJpq/s6+La5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)