UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4iI6msN7cDyOkAJXewpzn+fLdj7HutKIp0xwmMpGJpk=' 
WHERE 
  key_id = '8821c7890641a432daef835558e5f54b34928403c43183d1f59dbdd473bd7590' 
  AND (
    token = '4iI6msN7cDyOkAJXewpzn+fLdj7HutKIp0xwmMpGJpk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028