UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/qx22W38eJWaeT/BzREr1WN0xsHcgdOPsPZw5J8bFUs=' 
WHERE 
  key_id = '84c4841982050c20e9c76bd63dc013bff978cc65b759d881496829f7eca36920' 
  AND (
    token = '/qx22W38eJWaeT/BzREr1WN0xsHcgdOPsPZw5J8bFUs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044