UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X1t3b/l5G1InUUYGwuK5n2CGuqYwZrHAS3y118nEv8g=' 
WHERE 
  key_id = '5bcb3b69e90bf13645084a36d10dc22b6763d5e2165fd068ee38f93f8d34e39d' 
  AND (
    token = 'X1t3b/l5G1InUUYGwuK5n2CGuqYwZrHAS3y118nEv8g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017