UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vs7j5kfZPsmDYuTYXMK5/s0RfnCNFEMzQVHpM14BH9E=' 
WHERE 
  key_id = '209704ac1f4cd02e108764da646225cbb62e4fd49e5882a3b8529708c82327f4' 
  AND (
    token = 'vs7j5kfZPsmDYuTYXMK5/s0RfnCNFEMzQVHpM14BH9E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041