UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qUnvqTfXJKdOrb16XWed/2ucxCw+ahoplTY4wjeIs0E=' 
WHERE 
  key_id = '2bdadc2fd10f5a219113d017b7cbe3509d7fc1a923d7da28982ddbefe22f8a18' 
  AND (
    token = 'qUnvqTfXJKdOrb16XWed/2ucxCw+ahoplTY4wjeIs0E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041