UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yclv6+Q/q+0KGNSfp+ZoRa9tzIwaLP9SKrDxyT9kmgc=' 
WHERE 
  key_id = '0a7cc32ee8ef0b27d4f5d29a57d6188017de0f1fc87cda26dfc1595ba8dbd6de' 
  AND (
    token = 'Yclv6+Q/q+0KGNSfp+ZoRa9tzIwaLP9SKrDxyT9kmgc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042