UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ifWEwSOB/3/vn2xGcAUBvc3zgW2qBgS5RJKNzrHMXBA=' 
WHERE 
  key_id = '3c1a63ba262ba5d36a927ac0529f103025a043c9e2f9e2e652f4a76f3bd8d770' 
  AND (
    token = 'ifWEwSOB/3/vn2xGcAUBvc3zgW2qBgS5RJKNzrHMXBA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033