UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c++5DK9sK1BB+9+oNs1e4wl3Zyy5l+2FzdyJZwrHuG4=' 
WHERE 
  key_id = '99629c5aeada0a087d1ca61513b442714501dc12e101b76bbde655e3b7bacab1' 
  AND (
    token = 'c++5DK9sK1BB+9+oNs1e4wl3Zyy5l+2FzdyJZwrHuG4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027