UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lsUXjg14/PXf/PKe8yR1RdF2aye507+ECp1QzNuYwK8=' 
WHERE 
  key_id = '84e0e9d7dbeba68f09370d409ea76bb94812935bb71aa8fee8c1f72b0924417c' 
  AND (
    token = 'lsUXjg14/PXf/PKe8yR1RdF2aye507+ECp1QzNuYwK8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00132