UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BZ3sQdt/YokH2O93kWACEczDVUJ3Q6tY2ili3BYGliA=' 
WHERE 
  key_id = '08a65748049dd59c8455bfe778dc1f944e9c437817d9458bca0444a6b59bfae9' 
  AND (
    token = 'BZ3sQdt/YokH2O93kWACEczDVUJ3Q6tY2ili3BYGliA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038