UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BTwDCOqE4GS/kNQyfNUqbhR0G9m76iaHGl4j82jwMos=' 
WHERE 
  key_id = 'ee2a984a4b929dc6d16ad09458545646d8ba9d1814b9460a7e1f8c7754f41e9a' 
  AND (
    token = 'BTwDCOqE4GS/kNQyfNUqbhR0G9m76iaHGl4j82jwMos=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028