UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6tunUo+4P+UssrVTk3/KXIduY+WvsqjLi5vVZLbLnco=' 
WHERE 
  key_id = '2b07c360ffa7b77a8fa543f6b5eb88b09c0dce13e6674bacf783e361b6b8ec3c' 
  AND (
    token = '6tunUo+4P+UssrVTk3/KXIduY+WvsqjLi5vVZLbLnco=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030