UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IXoX0E9+FdJIzZPrYoutXBn+JQzooDBDvMO/Wj45izo=' 
WHERE 
  key_id = '4b79b1781aa72173b8ed2ac005bf81190f57b1c524942bc70fd6d38068abc7e7' 
  AND (
    token = 'IXoX0E9+FdJIzZPrYoutXBn+JQzooDBDvMO/Wj45izo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041