UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YDBKO+xw6JdGMXZx3clTrVteVvGwU/AqtdWpA2//S0w=' 
WHERE 
  key_id = '2b18b862da86ebec16137281aea2f05a5d6bb715b5b7cfd3bebb81c23435035b' 
  AND (
    token = 'YDBKO+xw6JdGMXZx3clTrVteVvGwU/AqtdWpA2//S0w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023