UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kxcv3itjwt075VuOX3Z7bQxpm+wGVKTy0DU3zOZsvGE=' 
WHERE 
  key_id = 'a1181bc30cad6d615e7ebb277ac7e8bd0b3908bebb9830855db03eb811f4c2a6' 
  AND (
    token = 'kxcv3itjwt075VuOX3Z7bQxpm+wGVKTy0DU3zOZsvGE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029