UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9q9Ew73dhIfHgrqY3G5IufUMORoFcT/pi3OiNIojjdE=' 
WHERE 
  key_id = 'adedaca38a4594bb91ed190d8db23773e94edab8010951669fa0c4cac83a742d' 
  AND (
    token = '9q9Ew73dhIfHgrqY3G5IufUMORoFcT/pi3OiNIojjdE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027