UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NurmNwCqm99p2eiKM4mkuAWgtCaqqNaXLQINUVT09x8=' 
WHERE 
  key_id = 'fba44132d5443f6597333e208cff572fe6e2443ec18f14ac85319c6fd6ecb7da' 
  AND (
    token = 'NurmNwCqm99p2eiKM4mkuAWgtCaqqNaXLQINUVT09x8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017