UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9uqlJfuENK5I8/6Cxl79BrlLJgGFdaDyYqMtTQO+acI=' 
WHERE 
  key_id = 'bbf5eb6ea7100faf7d3fb4f9354e4d52c556fdce6309d32ed1fe002eae20ebdc' 
  AND (
    token = '9uqlJfuENK5I8/6Cxl79BrlLJgGFdaDyYqMtTQO+acI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037