UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iLjg4+Q187Q1wMtOCM5CHOWS5uDMv1PmEMlZpcxZlRk=' 
WHERE 
  key_id = '740cabb792238d6a4e849aa0e87b69ecbdc0be8fe1b0557124ae28983248a6dc' 
  AND (
    token = 'iLjg4+Q187Q1wMtOCM5CHOWS5uDMv1PmEMlZpcxZlRk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018