UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'orI3jHSb8bbCSfV/P08B3m9rnVvnzG7/5B+RilOngVU=' 
WHERE 
  key_id = 'b72db680490dfcc0b2d1b3872d8574d3a4382884a3e4f049b5f6c0e9808570f0' 
  AND (
    token = 'orI3jHSb8bbCSfV/P08B3m9rnVvnzG7/5B+RilOngVU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028