UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AIMdqofYCP1QkQbwCYOD4cXvhlp2V/6rt8UxOVhJwrM='
WHERE
key_id = 'ee0902bf4e86a877c24220399b8f87ec35874d740d4ae56da7892e5174aea987'
AND (
token = 'AIMdqofYCP1QkQbwCYOD4cXvhlp2V/6rt8UxOVhJwrM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)