UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3l2utkh/gxSCtuLs+StHVJwgHV1KLUSlVfeYPIx2hpw=' 
WHERE 
  key_id = 'b3564f5a4c630494f0db2a270740d90c78f20239b03a239ea2337cde68401aae' 
  AND (
    token = '3l2utkh/gxSCtuLs+StHVJwgHV1KLUSlVfeYPIx2hpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023