UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ng6wPiJVrlw7jNbXQZ8e/cBCNq5ffsTW4cCoQfUUuCY=' 
WHERE 
  key_id = 'dbc35074e22e59d6ef9eb6b27eb06b681ca911e566c7aaaf9f1e15baa9afbd4c' 
  AND (
    token = 'ng6wPiJVrlw7jNbXQZ8e/cBCNq5ffsTW4cCoQfUUuCY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041